<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!doctype html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>LoveTemperature</title>
		<meta name="author" content="ningzero"/>

		<!-- CSS -->
		<link rel="stylesheet" href="../css/editShop.css">
		<!-- end CSS-->

	</head>

	<body>

		<div id="container">
			<header class="header">
				<div id="login_cart_bar">
					<div id="loginRegisterDiv">
						您好，<s:property value="#session.user.name" />
						<a class="pinkAnchor" href="http://localhost:8080/lovetemperature/sale/logout">退出登录</a>
					</div>
					<div id="cartAccountDiv">
						<a class="pinkAnchor">我的页面</a>
					</div>
				</div>
				<div id="logo_bar">
					<img src="../img/logo.gif"/>
					<img id="logo_text" src="../img/logo2.png"/>
				</div>
				<div id="nav_bar">
					<ul>
						<li class="nav_padding_left"></li>
						<li class='shouye'>
							<a href="http://localhost:8080/lovetemperature/sysadmin/showShop">店面管理</a>
						</li>
						<li class='dangao'>
							<a href="http://localhost:8080/lovetemperature/sysadmin/showStaff">员工管理</a>
						</li>
						<li class='mianbao'>
							<a href="http://localhost:8080/lovetemperature/sysadmin/showMember">会员管理</a>
						</li>
					</ul>
				</div>
			</header>
			<div id="mainContent" class="mainContent">
			<form action="http://localhost:8080/lovetemperature/sysadmin/submitShop" id="form">
				<div id="shopInfoDiv">
				<s:if test="%{newAdd==true}">
					<h4>新增店面信息</h4>
				</s:if>
				<s:else>
					<h4>修改店面信息</h4>
				</s:else>
					<p>　　店名：<input type="text" value='<s:property value="shop.name" />' name='shop.name'/></p>
					<p>　　地址：<input type="text" value='<s:property value="shop.address" />' name='shop.address'/></p>
					<p>　　电话：<input type="text" value='<s:property value="shop.phone" />' name='shop.phone'/></p>
					<s:if test="%{newAdd!=true}"><s:select id="managerSelecter" list="candidateManager" listKey="staffId" listValue="name" name="shopManagerId" label="分店经理"/></s:if>
				</div>
				<input type="hidden" name="shopId" value="<s:property value="shop.shopId" />" />
			</form>
				<div id="controlDiv">
				<s:if test="%{newAdd!=true}">
					<div class="normalBtn" onclick="editStaff(<s:property value="shop.shopId" />)">修改员工</div>
					<div class="normalBtn" onclick="delectShop(<s:property value="shop.shopId" />)">删除店面</div>
					<div class="normalBtn" onclick="javascript:history.back(-1);">取消</div>
					<div class="normalBtn" onclick="submit()">保存修改</div>
				</s:if>
				<s:else>
					<div class="normalBtn" onclick="javascript:history.back(-1);">取消</div>
					<div class="normalBtn" onclick="submit()">新增店面</div>
				</s:else>
				</div>
			</div>
		</div>
		<!--! end of #container -->
		
		<footer id="footer">
			<img src="../img/tmp/tmpfooter.png" />
		</footer>

		<!-- scripts -->
		<script type="text/javascript" src="../js/libs/jquery-1.9.1.min.js" ></script>
		<script type="text/javascript" src="../js/index.js" ></script>
		<script>
			$(function(){
				$('#managerSelecter').append('<option value="0">未选择</option>');
			});
			function editStaff(shopId){
				window.location="http://localhost:8080/lovetemperature/sysadmin/showStaff?shopId="+shopId;
			}
			function delectShop(shopId){
				window.location="http://localhost:8080/lovetemperature/sysadmin/delectShop?shopId="+shopId;
			}
			function submit(){
				$('#form').submit();
			}
		</script>
		<!-- end scripts-->
	</body>
</html>
